﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XYAuto.Utils.Data;

namespace XYAuto.MonitorData.Chitunion.Dal
{
    public class DoMonitor
    {
        private readonly string _connectStr;
        private readonly string _sql;

        public DoMonitor(string connectStr, string sql)
        {
            _connectStr = connectStr;
            _sql = sql;
        }

        public int ExcuteSql()
        {
            var obj = SqlHelper.ExecuteScalar(_connectStr, CommandType.Text, _sql);
            return obj == null ? 0 : Convert.ToInt32(obj);
        }
    }
}
